# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureViewIndexConfig do
  @moduledoc """
  Configuration for vector indexing.

  ## Attributes

  *   `bruteForceConfig` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureViewIndexConfigBruteForceConfig.t`, *default:* `nil`) - Optional. Configuration options for using brute force search, which simply implements the standard linear search in the database for each query. It is primarily meant for benchmarking and to generate the ground truth for approximate search.
  *   `crowdingColumn` (*type:* `String.t`, *default:* `nil`) - Optional. Column of crowding. This column contains crowding attribute which is a constraint on a neighbor list produced by FeatureOnlineStoreService.SearchNearestEntities to diversify search results. If NearestNeighborQuery.per_crowding_attribute_neighbor_count is set to K in SearchNearestEntitiesRequest, it's guaranteed that no more than K entities of the same crowding attribute are returned in the response.
  *   `distanceMeasureType` (*type:* `String.t`, *default:* `nil`) - Optional. The distance measure used in nearest neighbor search.
  *   `embeddingColumn` (*type:* `String.t`, *default:* `nil`) - Optional. Column of embedding. This column contains the source data to create index for vector search. embedding_column must be set when using vector search.
  *   `embeddingDimension` (*type:* `integer()`, *default:* `nil`) - Optional. The number of dimensions of the input embedding.
  *   `filterColumns` (*type:* `list(String.t)`, *default:* `nil`) - Optional. Columns of features that're used to filter vector search results.
  *   `treeAhConfig` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureViewIndexConfigTreeAHConfig.t`, *default:* `nil`) - Optional. Configuration options for the tree-AH algorithm (Shallow tree + Asymmetric Hashing). Please refer to this paper for more details: https://arxiv.org/abs/1908.10396
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :bruteForceConfig =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureViewIndexConfigBruteForceConfig.t()
            | nil,
          :crowdingColumn => String.t() | nil,
          :distanceMeasureType => String.t() | nil,
          :embeddingColumn => String.t() | nil,
          :embeddingDimension => integer() | nil,
          :filterColumns => list(String.t()) | nil,
          :treeAhConfig =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureViewIndexConfigTreeAHConfig.t()
            | nil
        }

  field(:bruteForceConfig,
    as:
      GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureViewIndexConfigBruteForceConfig
  )

  field(:crowdingColumn)
  field(:distanceMeasureType)
  field(:embeddingColumn)
  field(:embeddingDimension)
  field(:filterColumns, type: :list)

  field(:treeAhConfig,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureViewIndexConfigTreeAHConfig
  )
end

defimpl Poison.Decoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureViewIndexConfig do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureViewIndexConfig.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureViewIndexConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
